package com.example.communitypro.controller;



import com.example.communitypro.service.UserDetailsService;
import com.example.communitypro.pojo.UserDetails;
import com.example.communitypro.util.result.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
@Controller
@RequestMapping("/userDetails")
public class UserDetailsController {
    @Autowired
    private UserDetailsService userDetailsService;
    @ResponseBody
    @RequestMapping(value = "/addUserDetails")
    @CrossOrigin
    public Result addUserDetails(UserDetails record){
        return userDetailsService.addUserDetails(record);
    }
    @ResponseBody
    @RequestMapping(value = "/dropUserDetails")
    @CrossOrigin
    public Result dropUserDetails(Integer user_information_no){
        return userDetailsService.dropUserDetails(user_information_no);
    }

    @ResponseBody
    @RequestMapping(value = "/modifyUserDetails")
    @CrossOrigin
    public Result modifyUserDetails(UserDetails record){
        return userDetailsService.modifyUserDetails(record);
    }

    @ResponseBody
    @RequestMapping(value = "/queryUserDetails")
    @CrossOrigin
    public Result queryUserDetails(Integer user_information_no){
        return userDetailsService.queryUserDetails(user_information_no);
    }

    @ResponseBody
    @RequestMapping(value = "/queryUserDetailsByUser")
    @CrossOrigin
    public Result queryUserDetailsByUser(Integer user_no){
        return userDetailsService.queryByUser(user_no);
    }


    /**
     * lsl 查询所有
     * @return
     */
    @ResponseBody
    @RequestMapping(value = "/selectAll")
    @CrossOrigin
    public Result selectAll(){
        return userDetailsService.selectAll();
    }


}
